-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that alias-relate terms are WF if reporting an error in alias-relate #126404
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
if let Some(ty::PredicateKind::AliasRelate(lhs, rhs, _)) = pred_kind.no_bound_vars() { | ||
if let Some(obligation) = goal | ||
.infcx() | ||
.visit_proof_tree( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is jank and incorrect -- we're not inheriting a depth, so we can potentially stack overflow here.
Any ideas on a first-class way to create a custom nested obligation even though we don't have one in the proof tree? Should I just expose a constructor on InspectGoal
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, alternatively visit_proof_tree_at_depth
or sth? Not sure, I don't 100% like the current proof tree API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that for now. It shouldn't be difficult to change.
@bors r+ rollup |
…llaumeGomez Rollup of 9 pull requests Successful merges: - rust-lang#126229 (Bump windows-bindgen to 0.57) - rust-lang#126404 (Check that alias-relate terms are WF if reporting an error in alias-relate) - rust-lang#126410 (smir: merge identical Constant and ConstOperand types) - rust-lang#126478 (Migrate `run-make/codegen-options-parsing` to `rmake.rs`) - rust-lang#126496 (Make proof tree probing and `Candidate`/`CandidateSource` generic over interner) - rust-lang#126508 (Make uninitialized_error_reported a set of locals) - rust-lang#126517 (Migrate `run-make/dep-graph` to `rmake.rs`) - rust-lang#126525 (trait_selection: remove extra words) - rust-lang#126526 (tests/ui/lint: Move 19 tests to new `non-snake-case` subdir) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126404 - compiler-errors:alias-relate-terms, r=lcnr Check that alias-relate terms are WF if reporting an error in alias-relate Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given `<i32 as NotImplemented>::Assoc = ()` will drill down into `i32: NotImplemented` since we currently treat the projection as rigid. r? lcnr
Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given
<i32 as NotImplemented>::Assoc = ()
will drill down intoi32: NotImplemented
since we currently treat the projection as rigid.r? lcnr